﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JTicket.BLL;

namespace JTicket.UI
{
    public partial class JT_CardLoss : RoleBase
    {
        private readonly BLL.D_OperInfo bllOper = new BLL.D_OperInfo();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button2_Click1(object sender, EventArgs e)
        {
            if (t4.Text != "")
            {
                Model.D_KaInfo ka = DAL.D_KaInfo.GetModel(this.t1.Text);
                if (ka.pusername != null)
                {
                    this.t2.Text = ka.pusername;
                    this.t3.Text = ka.pusertel;
                    this.t4.Text = ka.puserid;
                    this.Label2.Text = ka.allamt.ToString();
                    if (ka.note == "0")
                        this.Label1.Text = "正常";
                    else
                        this.Label1.Text = "挂失";
                }
                else            
                    Common.JsMsg.Alert("未查询到卡信息");              
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (RadioButtonList1.SelectedItem.Value == "是")
            {
                string OperCode = bllOper.Oper().OperCode;
                string result = DAL.D_KaInfo.KaOperate(this.t4.Text, OperCode, this.t1.Text, "", "", "", "", "", "", "卡挂失"); 
                if (t1.Text != "")
                {
                    Model.D_KaInfo ka = DAL.D_KaInfo.GetModel(this.t1.Text);
                    if (ka.pusername != null)
                    {
                        this.t2.Text = ka.pusername;
                        this.t3.Text = ka.pusertel;
                        this.t4.Text = ka.puserid;
                        this.Label2.Text = ka.allamt.ToString();
                        if (ka.note == "0")
                            this.Label1.Text = "正常";
                        else
                            this.Label1.Text = "挂失";
                    }
                } Common.JsMsg.Alert(result);  

            }
        }
    }
}